package ihistoryApp.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;

@Service
public class RedisService {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    public void testConnection() {
        stringRedisTemplate.opsForValue().set("testKey", "Hello, Redis!");
        String value = stringRedisTemplate.opsForValue().get("testKey");
        System.out.println("Retrieved value: " + value);
    }
}
